import request from "@/router/axios";
// 基本信息开始

//查看详情
export function getBasicInfo(data) {
	return request({
		url: "/cp/workcontactwechat/show",
		method: "get",
		params: data,
	});
}

//修改详情
export function setDetailInfo(obj) {
	return request({
		url: "/cp/contactfieldpivotwechat/update",
		method: 'put',
		data: obj
	});
}
// 基本信息结束

// 画像信息开始

//所有企业标签分组列表-微信
export function allEnterpriseLabels() {
	return request({
		url: "/cp/workcontacttaggroupwechat",
		method: "get",
	});
}
//查询个人绑定企业标签
export function personalBindingEnterpriseLabel(query) {
	return request({
		url: "/cp/workcontactwechat/index_label",
		method: "get",
		params: query,
	});
}
//删除个人绑定企业标签
export function deletePersonalBindingEnterpriseLabel(obj) {
	return request({
		url: `/cp/workcontactwechat/${obj.wxExternalUserid}/${obj.wxUserId}/${obj.id}`,
		method: "delete"
	});
}
// 个人绑定企业标签保存
export function personalBindingEnterpriseLabelSave(obj) {
	return request({
		url: "/cp/workcontactwechat/save",
		method: "post",
		data: obj,
	});
}
//添加个人新标签
export function addPersonalLabels(obj) {
	return request({
		url: "/cp/employeewechat",
		method: "post",
		data: obj,
	});
}
// 查询所有个人标签
export function allPersonalAllLabels(query) {
	return request({
		url: "/cp/employeewechat/index",
		method: "get",
		params: query,
	});
}
// 个人已选中标签
export function personalTabSelected(query) {
	return request({
		url: "/cp/employeewechat/state",
		method: "get",
		params: query,
	});
}
// 删除个人所有标签
export function deletePersonalAllTab(id) {
	return request({
		url: `/cp/employeewechat/${id}`,
		method: "delete",
	});
}
// 保存个人选中标签
export function personalTabSelectedSave(obj) {
	return request({
		url: `/cp/employeewechat/change`,
		method: "post",
		data: obj
	});
}
// 删除展示标签
export function deletePersonalTabSelected(query) {
	return request({
		url: "/cp/employeewechat/del",
		method: "get",
		params: query,
	});
}
//新增待办
export function addTodo(obj) {
	return request({
		url: "/cp/employeedo",
		method: "post",
		data: obj
	});
}
//新增跟进
export function addFollow(obj) {
	return request({
		url: "/cp/employeefollow",
		method: "post",
		data: obj
	});
}
// 画像信息结束

// 客户动态 开始

// 待办事项-列表查询
export function queryCommissionList(obj) {
	return request({
		url: "/cp/employeedo/page",
		method: "get",
		params: obj
	});
}
// 跟进待办
export function changeToDoState(obj) {
	return request({
		url: `/cp/employeedo/change/${obj.id}/${obj.state}`,
		method: "get"
	});
}
// 待办信息修改
export function updateToDoInfo(obj) {
	return request({
		url: `/cp/employeedo`,
		method: "put",
		data: obj
	});
}
// 跟进记录-列表查询
export function queryFollowList(obj) {
	return request({
		url: "/cp/employeefollow/page",
		method: "get",
		params: obj
	});
}
// 跟进记录-修改信息
export function updateFollowInfo(obj) {
	return request({
		url: "/cp/employeefollow",
		method: "put",
		data: obj
	});
}
// 跟进记录-删除数据
export function deleteFollow(obj) {
	return request({
		url: `/cp/employeefollow/${obj.id}`,
		method: "delete",
		data: obj
	});
}
// 客户动态-列表查询 （包括 客户轨迹、跟进记录、待办列表）
export function workContactWeChatList(obj) {
	return request({
		url: `/cp/workcontactwechat/track`,
		method: "get",
		params: obj
	});
}
// 金融提醒-客户详情-动态-列表查询 （包括 客户动态、跟进记录、待办列表）
export function customerTrackData(obj) {
	return request({
		url: `/cp/workcontactwechat/trajectory`,
		method: "get",
		params: obj
	});
}


// 客户动态 结束
// 转接客户
// 查询成员列表
export function queryMemberList(obj) {
	return request({
		url: `/cp/workemployeewechat/page`,
		method: "get",
		params: obj
	});
}
// 模糊搜索成员
// export function fuzzySearchMember (obj) {
//   return request({
//     url: `/cp/workemployeewechat/searchcondition`,
//     method: "get",
//     params: obj
//   });
// }
// 转接客户确认
export function transferCustomer(obj) {
	return request({
		url: `/cp/workemployeewechat/change/${obj.wxUserId}/${obj.wxExternalUserid}/${obj.id}`,
		method: "get",
	});
}
//客户详情上传封面
export function uploadImage(obj) {
	return request({
		url: 'cp/upload',
		method: "post",
		data: obj,
		headers: {
			"content-type": "multipart/form-data"
		}
	});
}

export function addBlackList(obj) {
	return request({
		url: "/cp/workEmployeeOperate/BlacklistSave",
		method: "post",
		data: obj
	});
}


// 除单聊以外的入口需要获取成员的客户列表作为客户备选数据
export function customerListByWxUserId(obj) {
	return request({
		url: `/cp/workcontactwechat/client-list`,
		method: "get",
		params: obj
	});
}